Skip to content

Fix assay/experiment metrics bugs and modernize Java syntax#7613

Merged
labkey-jeckels merged 1 commit intodevelopfrom
fb_experimentMetrics
Apr 23, 2026
Merged

Fix assay/experiment metrics bugs and modernize Java syntax#7613
labkey-jeckels merged 1 commit intodevelopfrom
fb_experimentMetrics

Conversation

@labkey-jeckels
Copy link
Copy Markdown
Contributor

@labkey-jeckels labkey-jeckels commented Apr 22, 2026

Rationale

Fix two pre-existing bugs in experiment/assay metrics reporting, and clean up related code as part of the same pass.

Related Pull Requests

None

Changes

  • Bug fix: RequiredSourceParentsForSampleTypes in ExperimentServiceImpl.getParentAliasMetrics() was reporting samplesMetrics.first (sample parent count) instead of samplesMetrics.second (source/data parent count)
  • Bug fix: protocolsWithTransformScriptRunOnEditCount in ExperimentModule was using the same LIKE '%"INSERT"%' pattern as the import count; now correctly uses TransformOperation.UPDATE
  • Refactor: Replace private ScriptType enum (single value) with a public static final TRANSFORM_SCRIPT_PROPERTY_NAME constant, allowing ExperimentModule to reference it without duplication
  • Improvement: Parameterize the assay metrics SQL queries in ExperimentModule
  • Cleanup: Remove dead PageFlowUtil methods streamTextAsImage() and getSessionId()
  • Modernization: Unnamed lambda variables (_), List.getFirst(), instanceof pattern variables, URI.create(), isEmpty()
  • Observability: Replace printStackTrace() with proper _log.error() in XML serialization error handler

- Fix RequiredSourceParentsForSampleTypes metric using .first (sample count)
  instead of .second (source/data count) in ExperimentServiceImpl
- Fix protocolsWithTransformScriptRunOnEditCount using INSERT LIKE pattern
  instead of UPDATE; both edit and import metrics were counting the same thing
- Parameterize SQL queries in ExperimentModule assay metrics
- Extract ScriptType private enum to public TRANSFORM_SCRIPT_PROPERTY_NAME
  constant so ExperimentModule can reference it without duplication
- Remove dead PageFlowUtil methods: streamTextAsImage() and getSessionId()
- Modernize Java syntax: unnamed lambda vars, getFirst(), pattern variables,
  URI.create(), isEmpty()
- Improve XML serialization error to use logger instead of printStackTrace()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@labkey-jeckels labkey-jeckels self-assigned this Apr 22, 2026
@labkey-nicka labkey-nicka added this to the 26.05 milestone Apr 23, 2026
@labkey-jeckels labkey-jeckels merged commit 3735f3a into develop Apr 23, 2026
12 of 15 checks passed
@labkey-jeckels labkey-jeckels deleted the fb_experimentMetrics branch April 23, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants